	<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a>用户列表</a></li>
		</ul>
		<form class="well form-search" method="post" action="">
		<if condition="(get_current_admin_id() eq 1 || get_groups_admin_user() eq 8 || get_groups_admin_user() eq 10 || get_groups_admin_user() eq 6 || get_groups_admin_user() eq 14)">
			<select name="id">
				<php>$i=1;</php>
				<foreach name="links" item="vo">
				<php>$sel=I('request.id')==$i?'selected':'';</php>
				<option value="{$i}" {$sel}>{$vo.name}</option>
				<php>$i++;</php>
				</foreach>
			</select>		
		</if>		
		姓名：<input type="text" name="name" style="width: 200px;" value="{:I('request.name')}" placeholder="姓名">
			注册日期：<input class="js-datetime" type="text" name="starts" style="width: 200px;" value="{:I('request.starts')}" placeholder="起始时间">
			<input class="js-datetime" type="text" name="ends" style="width: 200px;" value="{:I('request.ends')}" placeholder="结束时间">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="">清空</a>
		</form>
		<form method="post" class="js-ajax-form">
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th  align="center">姓名</th>
						<th>手机号码</th>
						<th>年龄</th>
						<th>借款金额</th>
						<th>注册时间</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="list" item="vo">
					<tr>
						<td align="center">{$vo.name|default='未填写'}</td>
						<td>{$vo.mobile}</td>
						<php>$iden=substr($vo['identity'],6,8)</php>
						<td>{$iden|default=''}</td>
						<td><if condition="($vo.status eq 0)">0元
						<elseif condition="$vo.status eq 1"/>{$vo.amount|default='0'}元
						<elseif condition="$vo.status eq 2"/>{$vo.amount|default='0'}元
						<elseif condition="$vo.status eq 3"/>{$vo.amount|default='0'}元
						<elseif condition="$vo.status eq 4"/>{$vo.amount|default='0'}元
						<elseif condition="$vo.status eq 5"/>0元
						<elseif condition="$vo.status eq 6"/>0元
						<elseif condition="$vo.status eq 7"/>0元
						<elseif condition="$vo.status eq 8"/>{$vo.amount|default='0'}元
						<elseif condition="$vo.status eq 9"/>0元
						<elseif condition="$vo.status eq 10"/>0元
						</if></td>
						<td>{$vo.crtime}</td>
					</tr>
					</foreach>
				</tbody>
				<tfoot>
				<tr>
					<td>当页合计：</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
				</tr>
				</tfoot>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
        $(function () {
            var arr = [3];//要取哪几列的合计
            var def = 'var ';
            for(var a in arr){
                def += ('total'+arr[a]+'=0,');
            }
            def=def.substring(0,def.length-1)+';';
            eval(def);//执行定义
            $('tbody tr').each(function() {
                for(var i in arr){
                    $(this).find('td:eq('+arr[i]+')').each(function(){
                        var tmp = $(this).text();
                        if(tmp === ''){
                            tmp = 0;
                        }
                        eval('total'+arr[i]+'+=parseFloat(tmp);');
                    });
                }
            });
            for(var x in arr){
                $('tfoot tr:eq(0)').find('td:eq('+arr[x]+')').text(eval('total'+arr[x]));
            }
        });
	</script>
</body>
</html>